﻿using System.Data.Entity.ModelConfiguration;
using yiCommerce.Core.Domain.Customers;

namespace yiCommerce.Data.Mapping.Customers
{
    public class CustomerTagMapping : EntityTypeConfiguration<CustomerInterestedTag>
    {
        public CustomerTagMapping()
        {
            this.ToTable("Customer_Interested_Tag_Mapping");
            this.HasKey(pp => pp.Id);

            this.HasRequired(pp => pp.Customer)
                .WithMany(p => p.CustomerInterestedTags)
                .HasForeignKey(pp => pp.CustomerId);


            this.HasRequired(pp => pp.Tag)
                .WithMany(p => p.CustomerInterestedTags)
                .HasForeignKey(pp => pp.TagId);
        }

    }
}